<?php	
class Obj_SpecialOffersSetter {
	
	protected static $t;
	
	public static function init() {
		self::$t = new Obj_DBTable_SpecialOffersSetter();
	}
	
	public static function saveSpecialOffersSetter($arData, $id) {
		if ((int)$id == (int)0) {
			return self::$t->insert($arData);
		}
		else self::$t->update($arData, 'ObjectID = '.intval($id));
		return intval($id);
	}

	public static function getAllSpecialOffers() {
		$ar_ = self::$t->getAllSpecialOffers();
		$ar = array();
		foreach ($ar_ as $k => $v) {
			$ar[$v['ID']] = $v;
		}
		return $ar;
	}

	public static function getSpecialOffersSetterByObject($id) {
		return self::$t->getSpecialOffersSetterByObject($id);
	}

	public static function getSpecialOffersSetterByOffer($id) {
		return self::$t->getSpecialOffersSetterByOffer($id);
	}
		
	public static function delSpecialOffersSetter($ObjectID){
		return self::$t->delete('ObjectID = '.intval($ObjectID));
	}	
	
}Obj_SpecialOffersSetter::init();

